﻿using System.Security.Cryptography;

namespace Lib.Security;
/// <summary>
/// 加解密实体类
/// </summary>
public class RSAEntity {
    /// <summary>
    /// 创建加解密实体类
    /// </summary>
    /// <param name="PublicKey"></param>
    /// <param name="PrivateKey"></param>
    /// <param name="Sign"></param>
    /// <param name="Code"></param>
    /// <param name="Data"></param>
    /// <param name="Signature"></param>
    /// <param name="Result"></param>
    /// <returns></returns>
    public static RSAEntity Create(string PublicKey = null, string PrivateKey = null, string Data = null, string Result = null, string Sign = null, AlgorithType? Code = null, string Signature = null) {
        return new RSAEntity(PublicKey, PrivateKey, Data, Result, Sign, Code, Signature);
    }
    /// <summary>
    /// 
    /// </summary>
    /// <param name="PublicKey"></param>
    /// <param name="PrivateKey"></param>
    /// <param name="Sign"></param>
    /// <param name="Code"></param>
    /// <param name="Data"></param>
    /// <param name="Signature"></param>
    /// <param name="Result"></param>
    public RSAEntity(string PublicKey = null, string PrivateKey = null, string Data = null, string Result = null, string Sign = null, AlgorithType? Code = null, string Signature = null) {
        this.PublicKey = PublicKey;
        this.PrivateKey = PrivateKey;
        this.Sign = Sign;
        this.Signature = Signature;
        this.Code = Code;
        this.Data = Data;
        this.Result = Result;
    }

    /// <summary>
    /// 公钥
    /// </summary>
    public string PublicKey { get; set; }
    /// <summary>
    /// 私钥
    /// </summary>
    public string PrivateKey { get; set; }
    /// <summary>
    /// 加密数据
    /// </summary>
    public string Data { get; set; }
    /// <summary>
    /// 加密结果
    /// </summary>
    public string Result { get; set; }


    /// <summary>
    /// 签名数据
    /// </summary>
    public string Sign { get; set; }
    /// <summary>
    /// 签名加密方式（MD5、SHA1、SHA256、SHA384、SHA512）
    /// </summary>
    public AlgorithType? Code { get; set; }
    /// <summary>
    /// 签名结果
    /// </summary>
    public string Signature { get; set; }



}